<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\File;
use App\Http\Controllers\WebSocketController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/{any}', function () {
    $filePath = public_path('gganswer/index.html');
    // 检查文件是否存在
    if (File::exists($filePath)) {
        // 读取并返回文件内容
        return File::get($filePath);
    } else {
        // 文件不存在的处理
        return response('File not found', 404);
    }
    // return view('welcome');
    // return '欢迎来到GG世界';
    // return redirect("/gganswer/index.html");
})->where('any', '.*');
